using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.OleDb;
using DTO;

namespace DAO
{
   public class ChiTietThanhLyDAO
    {
       public List<ChiTietThanhLyDTO> _laydanhsachthanhly_DAO()
       {
           List<ChiTietThanhLyDTO> list = new List<ChiTietThanhLyDTO>();
           string sql = "select * from ChiTietThanhLh ";
           DataTable dt = DataProvider.ExcuteQuery(sql);
           if (dt.Rows.Count > 0)
           {
               for(int i= 0; i<dt.Rows .Count ;i++) 
               {
                   DataRow dr = dt.Rows [i];
                   int mathanhly = int.Parse(dr["MaThanhly"].ToString());
                   int masach = int.Parse(dr["MaSach"].ToString());
                   int lydo = int.Parse(dr["LyDo"].ToString());
                   ChiTietThanhLyDTO cttl = new ChiTietThanhLyDTO();
                   cttl.Mathanhly = mathanhly;
                   cttl.Masach = masach;
                   cttl.Lydo = lydo;
                   list.Add(cttl);
               }
           }
           return list;
       }
    }
}
